package com.mapper;

import com.entity.LotteryDrawRecord;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @InterfaceName LotteryDrawRecordMapper
 * @Description 抽奖记录持久层接口
 * @Author Kx
 * @Date 2025/6/18 11:20
 * @Version 1.0
 */
public interface LotteryDrawRecordMapper {
    /**
     * @author: kx
     * @date: 2025/6/18 11:22
     * @param lotteryDrawRecord : 抽奖记录
     * @description: 添加抽奖记录
    */
    void addLotteryDrawRecord(@Param("lotteryDrawRecord") LotteryDrawRecord lotteryDrawRecord);

    /**
     * @author: kx
     * @date: 2025/6/18 19:41
     * @param userId : 用户id
     * @return java.util.List<com.entity.LotteryDrawRecord>
     * @description: 根据用户id查询该用户的抽奖记录
    */
    List<LotteryDrawRecord> findByUserId(@Param("userId") Integer userId);

    /**
     * @author: kx
     * @date: 2025/6/18 20:16
     * @param pageNum : 页码
     * @param pageSize : 每页数量
     * @return java.util.List<com.entity.LotteryDrawRecord>
     * @description: 分页查询所有抽奖记录
    */
    List<LotteryDrawRecord> findPagedAllRecords(@Param("pageNum") Integer pageNum, @Param("pageSize") Integer pageSize);

    /**
     * @author: kx
     * @date: 2025/6/19 10:56
     * @param keyword : 关键字
     * @param pageNum : 页码
     * @param pageSize : 每页数量
     * @return java.util.List<com.entity.LotteryDrawRecord>
     * @description: 根据用户名称模糊分页查询抽奖记录
    */
    List<LotteryDrawRecord> findRecordsByKeyword(@Param("keyword") String keyword, @Param("pageNum") Integer pageNum, @Param("pageSize") Integer pageSize);
}
